﻿@model IEnumerable<Authoring.WebRole.Models.ContentKeyword>

@{
    ViewBag.Title = "Index";
}

<h2>ContentKeyword</h2>

<p>
    @if (ViewBag.write)
    {
        @Html.ActionLink("Create New", "Create")
    }
</p>
<table>
    <tr>
        <th>
            ContentItem
        </th>
        <th>
            Keyword
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ContentItem.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Keyword.Keyword1)
        </td>
        <td>
        @if(ViewBag.delete) 
        {
 
            @Html.ActionLink("Edit", "Edit", new { id=item.ContentKeywordID })  
            @String.Format("{0}", "|");
            @Html.ActionLink("Details", "Details", new { id=item.ContentKeywordID }) 
            @String.Format("{0}", "|");
            @Html.ActionLink("Delete", "Delete", new { id = item.ContentKeywordID })
            
        }
        else if (ViewBag.write)
        {
            @Html.ActionLink("Edit", "Edit", new { id = item.ContentKeywordID }) 
            @String.Format("{0}", "|");
            @Html.ActionLink("Details", "Details", new { id = item.ContentKeywordID })
        }
        else if (ViewBag.read)
        { 

            @Html.ActionLink("Details", "Details", new { id = item.ContentKeywordID })

        }            
        </td>
    </tr>
}

</table>
